import re

data = """
---------------------
FLOPs: 15.89M, Params: 0.47M
---------------------
FLOPs: 45.71M, Params: 1.38M
---------------------
FLOPs: 72.57M, Params: 2.05M
---------------------
FLOPs: 93.08M, Params: 2.90M
---------------------
FLOPs: 124.94M, Params: 3.57M
---------------------
FLOPs: 137.19M, Params: 4.27M
---------------------
FLOPs: 276.24M, Params: 5.75M
---------------------
FLOPs: 303.61M, Params: 7.08M

"""

# 使用正则表达式提取所有FLOPS数据
# \s* 匹配 "FLOPs:" 和数字之间的任何空格
# ([\d.]+) 是一个捕获组，用于匹配并提取一个或多个数字和句点（即浮点数）
# M 匹配字母 "M"
flops = re.findall(r"FLOPs:\s*([\d.]+)M", data)

# 逐行输出提取的FLOPS数据，并在末尾添加 'e'
for flop in flops:
    print(flop + 'e6')